Page({
    data: {
        dates: '2016-11-08',
        index: 0,
        date: '2016-11-08'
    },
    //  点击日期组件确定事件  
    bindDateChange: function (e) {
        console.log(e.detail.value)
        this.setData({
            dates: e.detail.value
        })
    },
    bindDateChanges: function (e) {
      console.log(e.detail.value)
      this.setData({
        date: e.detail.value
      })
    },
    onShow: function () {
      var app = getApp()
      var that = this;
      var uid = wx.getStorageSync('uid');
      // console.log(uid)
      wx.request({
        // url: app.globalData.host + '&g=App&m=User&a=my_ewm',
        url: app.globalData.host + '&g=App&m=User&a=my_money',
        data: { uid: uid },
        header: {
          'content-type': 'application/json'
        },
        success: function (res){
          console.log(res.data)
          var ad = res.data.ad;
          that.setData({
            list: res.data.list,
            money: res.data.moneyAll,
            ewm: res.data.ewm
          })
        }
      })
    },
    nav: function (e) {
      var money = this.data.money;
      if (money > 0) {
        wx.navigateTo({
          url: '/page/member/withdraw'
        })
      } else {
        wx.showModal({
          title: '提示',
          content: '无可提现金额',
          showCancel: false,
          duration: 2000,
        })
      }
    }
})